<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>应用配置 | Vue.js</title>
    <meta name="generator" content="VuePress 1.5.4">
    <link href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600|Open+Sans:400,600;display=swap" rel="stylesheet">
    <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="icon" href="/logo.png">
    <script src="https://player.youku.com/iframeapi"></script>
    <meta name="description" content="Vue.js - The Progressive JavaScript Framework">
    <link rel="preload" href="/assets/css/0.styles.60414370.css" as="style"><link rel="preload" href="/assets/js/app.0a9bf1a0.js" as="script"><link rel="preload" href="/assets/js/9.f307b0a5.js" as="script"><link rel="preload" href="/assets/js/18.9c9769d1.js" as="script"><link rel="preload" href="/assets/js/10.523605bb.js" as="script"><link rel="preload" href="/assets/js/36.e0922c67.js" as="script"><link rel="prefetch" href="/assets/js/1.832c44bf.js"><link rel="prefetch" href="/assets/js/100.6c7a3206.js"><link rel="prefetch" href="/assets/js/101.656addb5.js"><link rel="prefetch" href="/assets/js/102.fddd4c59.js"><link rel="prefetch" href="/assets/js/103.8b570fcc.js"><link rel="prefetch" href="/assets/js/104.b1a5605a.js"><link rel="prefetch" href="/assets/js/105.edde2e45.js"><link rel="prefetch" href="/assets/js/106.3b04c318.js"><link rel="prefetch" href="/assets/js/107.98cab24c.js"><link rel="prefetch" href="/assets/js/108.15d2ab25.js"><link rel="prefetch" href="/assets/js/109.5f483cd0.js"><link rel="prefetch" href="/assets/js/11.43202c8c.js"><link rel="prefetch" href="/assets/js/110.de44b32c.js"><link rel="prefetch" href="/assets/js/111.e247818d.js"><link rel="prefetch" href="/assets/js/112.f330b33d.js"><link rel="prefetch" href="/assets/js/113.d26db724.js"><link rel="prefetch" href="/assets/js/114.4a085227.js"><link rel="prefetch" href="/assets/js/115.6f41e46c.js"><link rel="prefetch" href="/assets/js/116.d9f31fc2.js"><link rel="prefetch" href="/assets/js/117.6bc037ec.js"><link rel="prefetch" href="/assets/js/118.b6d13098.js"><link rel="prefetch" href="/assets/js/119.40081175.js"><link rel="prefetch" href="/assets/js/12.9ac43f9f.js"><link rel="prefetch" href="/assets/js/120.dc59e2a2.js"><link rel="prefetch" href="/assets/js/121.5d6c245d.js"><link rel="prefetch" href="/assets/js/122.44eb5e5a.js"><link rel="prefetch" href="/assets/js/123.2fbebc5c.js"><link rel="prefetch" href="/assets/js/124.9733dae9.js"><link rel="prefetch" href="/assets/js/125.35fe073b.js"><link rel="prefetch" href="/assets/js/126.b2d1ea91.js"><link rel="prefetch" href="/assets/js/127.3d7f3105.js"><link rel="prefetch" href="/assets/js/128.aa600ea3.js"><link rel="prefetch" href="/assets/js/129.92b123b0.js"><link rel="prefetch" href="/assets/js/13.61cfe0ac.js"><link rel="prefetch" href="/assets/js/130.65930d6d.js"><link rel="prefetch" href="/assets/js/131.fe452d41.js"><link rel="prefetch" href="/assets/js/132.8db41894.js"><link rel="prefetch" href="/assets/js/133.2422a318.js"><link rel="prefetch" href="/assets/js/134.28ae1eb3.js"><link rel="prefetch" href="/assets/js/135.854307ee.js"><link rel="prefetch" href="/assets/js/136.42e4e007.js"><link rel="prefetch" href="/assets/js/137.c557b795.js"><link rel="prefetch" href="/assets/js/138.8314e9f0.js"><link rel="prefetch" href="/assets/js/139.4a91ed8c.js"><link rel="prefetch" href="/assets/js/14.c6ae250c.js"><link rel="prefetch" href="/assets/js/140.5be2f667.js"><link rel="prefetch" href="/assets/js/141.02fbd174.js"><link rel="prefetch" href="/assets/js/142.f1c4e87e.js"><link rel="prefetch" href="/assets/js/143.59791aa7.js"><link rel="prefetch" href="/assets/js/144.fb6601d0.js"><link rel="prefetch" href="/assets/js/145.11777ee6.js"><link rel="prefetch" href="/assets/js/15.99a67fb3.js"><link rel="prefetch" href="/assets/js/16.54274551.js"><link rel="prefetch" href="/assets/js/17.620b927c.js"><link rel="prefetch" href="/assets/js/19.3a6eb738.js"><link rel="prefetch" href="/assets/js/2.10e2fb64.js"><link rel="prefetch" href="/assets/js/20.4f240fd5.js"><link rel="prefetch" href="/assets/js/21.b5c24ec0.js"><link rel="prefetch" href="/assets/js/22.6b36d53a.js"><link rel="prefetch" href="/assets/js/23.0742dc98.js"><link rel="prefetch" href="/assets/js/24.490994ab.js"><link rel="prefetch" href="/assets/js/25.854225c9.js"><link rel="prefetch" href="/assets/js/26.cb8bede1.js"><link rel="prefetch" href="/assets/js/27.01fe0de5.js"><link rel="prefetch" href="/assets/js/28.8d33f619.js"><link rel="prefetch" href="/assets/js/29.1005b103.js"><link rel="prefetch" href="/assets/js/3.4ba5caef.js"><link rel="prefetch" href="/assets/js/30.0629b722.js"><link rel="prefetch" href="/assets/js/31.41c2c5b0.js"><link rel="prefetch" href="/assets/js/32.7709b53d.js"><link rel="prefetch" href="/assets/js/33.7e973829.js"><link rel="prefetch" href="/assets/js/34.107475bf.js"><link rel="prefetch" href="/assets/js/35.e83bdd9b.js"><link rel="prefetch" href="/assets/js/37.af806c96.js"><link rel="prefetch" href="/assets/js/38.94bae313.js"><link rel="prefetch" href="/assets/js/39.f15cd956.js"><link rel="prefetch" href="/assets/js/4.b65b2ec4.js"><link rel="prefetch" href="/assets/js/40.18818521.js"><link rel="prefetch" href="/assets/js/41.cc39555d.js"><link rel="prefetch" href="/assets/js/42.eb469d2e.js"><link rel="prefetch" href="/assets/js/43.7bdc7f53.js"><link rel="prefetch" href="/assets/js/44.c15154a9.js"><link rel="prefetch" href="/assets/js/45.e28b1e26.js"><link rel="prefetch" href="/assets/js/46.1a582225.js"><link rel="prefetch" href="/assets/js/47.1681e4e7.js"><link rel="prefetch" href="/assets/js/48.c7e4df2a.js"><link rel="prefetch" href="/assets/js/49.24a40e32.js"><link rel="prefetch" href="/assets/js/5.436c63ff.js"><link rel="prefetch" href="/assets/js/50.79ca1e35.js"><link rel="prefetch" href="/assets/js/51.4d6124d9.js"><link rel="prefetch" href="/assets/js/52.93b75fa3.js"><link rel="prefetch" href="/assets/js/53.99ab0219.js"><link rel="prefetch" href="/assets/js/54.91605e00.js"><link rel="prefetch" href="/assets/js/55.d1fdbf6f.js"><link rel="prefetch" href="/assets/js/56.e162390f.js"><link rel="prefetch" href="/assets/js/57.af6ab199.js"><link rel="prefetch" href="/assets/js/58.71eff2a5.js"><link rel="prefetch" href="/assets/js/59.b70c19c9.js"><link rel="prefetch" href="/assets/js/6.1bc8dee2.js"><link rel="prefetch" href="/assets/js/60.03187705.js"><link rel="prefetch" href="/assets/js/61.c9596d10.js"><link rel="prefetch" href="/assets/js/62.28b9a2e8.js"><link rel="prefetch" href="/assets/js/63.a5f17acf.js"><link rel="prefetch" href="/assets/js/64.deca5d49.js"><link rel="prefetch" href="/assets/js/65.8014765f.js"><link rel="prefetch" href="/assets/js/66.c136f2b4.js"><link rel="prefetch" href="/assets/js/67.55b8c4d6.js"><link rel="prefetch" href="/assets/js/68.ff568b2f.js"><link rel="prefetch" href="/assets/js/69.cbb0de95.js"><link rel="prefetch" href="/assets/js/70.9a450c62.js"><link rel="prefetch" href="/assets/js/71.56ddc8d7.js"><link rel="prefetch" href="/assets/js/72.ff8c82c4.js"><link rel="prefetch" href="/assets/js/73.5a3ae71c.js"><link rel="prefetch" href="/assets/js/74.d43f66e7.js"><link rel="prefetch" href="/assets/js/75.a0490d28.js"><link rel="prefetch" href="/assets/js/76.51277fc3.js"><link rel="prefetch" href="/assets/js/77.12725190.js"><link rel="prefetch" href="/assets/js/78.e3426443.js"><link rel="prefetch" href="/assets/js/79.34f80eb5.js"><link rel="prefetch" href="/assets/js/80.e7d07c97.js"><link rel="prefetch" href="/assets/js/81.497c1c98.js"><link rel="prefetch" href="/assets/js/82.5edfa1e6.js"><link rel="prefetch" href="/assets/js/83.72c9f367.js"><link rel="prefetch" href="/assets/js/84.72494822.js"><link rel="prefetch" href="/assets/js/85.02c708f2.js"><link rel="prefetch" href="/assets/js/86.75fdd91f.js"><link rel="prefetch" href="/assets/js/87.431ab614.js"><link rel="prefetch" href="/assets/js/88.06c97259.js"><link rel="prefetch" href="/assets/js/89.1c6506f7.js"><link rel="prefetch" href="/assets/js/90.7f074177.js"><link rel="prefetch" href="/assets/js/91.82276ba6.js"><link rel="prefetch" href="/assets/js/92.2d5fa7b8.js"><link rel="prefetch" href="/assets/js/93.9ae1367c.js"><link rel="prefetch" href="/assets/js/94.3ba6340b.js"><link rel="prefetch" href="/assets/js/95.e31bf445.js"><link rel="prefetch" href="/assets/js/96.b6f4c3e4.js"><link rel="prefetch" href="/assets/js/97.fd612974.js"><link rel="prefetch" href="/assets/js/98.fc2e9816.js"><link rel="prefetch" href="/assets/js/99.ea1b3d86.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.a100821a.js">
    <link rel="stylesheet" href="/assets/css/0.styles.60414370.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><!----> <header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/logo.png" alt="Vue.js" class="logo"> <span class="site-name can-hide">Vue.js</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="文档菜单" class="dropdown-title"><span class="title">文档</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/guide/introduction.html" class="nav-link">
  教程
</a></li><li class="dropdown-item"><!----> <a href="/guide/migration/introduction.html" class="nav-link">
  v3 迁移指南
</a></li><li class="dropdown-item"><!----> <a href="/style-guide/" class="nav-link">
  风格指南
</a></li><li class="dropdown-item"><!----> <a href="/cookbook/" class="nav-link">
  Cookbook
</a></li><li class="dropdown-item"><!----> <a href="/examples/markdown.html" class="nav-link">
  示例
</a></li></ul></div></div><div class="nav-item"><a href="/api/application-config.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  API Reference
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="生态系统" class="dropdown-title"><span class="title">生态系统</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          社区
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/community/team/" class="nav-link">
  团队
</a></li><li class="dropdown-subitem"><a href="/community/partners.html" class="nav-link">
  合作伙伴
</a></li><li class="dropdown-subitem"><a href="/community/join/" class="nav-link">
  加入
</a></li><li class="dropdown-subitem"><a href="/community/themes/" class="nav-link">
  主题
</a></li></ul></li><li class="dropdown-item"><h4>
          官方项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://next.router.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vue Router
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://vuex.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vuex
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://cli.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vue CLI
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://vuejs.github.io/vue-test-utils-next-docs/guide/introduction.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vue Test Utils
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vue-devtools" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Devtools
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://news.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Weekly news
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="支持 Vue" class="dropdown-title"><span class="title">支持 Vue</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/support-vuejs/#one-time-donations" class="nav-link">
  一次性捐款
</a></li><li class="dropdown-item"><!----> <a href="/support-vuejs/#recurring-pledges" class="nav-link">
  周期性捐款
</a></li><li class="dropdown-item"><!----> <a href="https://www.smallsticker.com/%E8%B4%B4%E7%BA%B8/vue.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  贴纸
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://osholic.com/?utm_source=vue&amp;utm_medium=dropdown" target="_blank" rel="noopener noreferrer" class="nav-link external">
  周边
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://vue.threadless.com/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  T-Shirt 商店
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="多语言" class="dropdown-title"><span class="title">多语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://v3.vuejs.org" target="_blank" rel="noopener noreferrer" class="nav-link external">
  English
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <a href="https://github.com/vuejs/docs-next-zh-cn" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav> <!----></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="文档菜单" class="dropdown-title"><span class="title">文档</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/guide/introduction.html" class="nav-link">
  教程
</a></li><li class="dropdown-item"><!----> <a href="/guide/migration/introduction.html" class="nav-link">
  v3 迁移指南
</a></li><li class="dropdown-item"><!----> <a href="/style-guide/" class="nav-link">
  风格指南
</a></li><li class="dropdown-item"><!----> <a href="/cookbook/" class="nav-link">
  Cookbook
</a></li><li class="dropdown-item"><!----> <a href="/examples/markdown.html" class="nav-link">
  示例
</a></li></ul></div></div><div class="nav-item"><a href="/api/application-config.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  API Reference
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="生态系统" class="dropdown-title"><span class="title">生态系统</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          社区
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/community/team/" class="nav-link">
  团队
</a></li><li class="dropdown-subitem"><a href="/community/partners.html" class="nav-link">
  合作伙伴
</a></li><li class="dropdown-subitem"><a href="/community/join/" class="nav-link">
  加入
</a></li><li class="dropdown-subitem"><a href="/community/themes/" class="nav-link">
  主题
</a></li></ul></li><li class="dropdown-item"><h4>
          官方项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://next.router.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vue Router
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://vuex.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vuex
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://cli.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vue CLI
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://vuejs.github.io/vue-test-utils-next-docs/guide/introduction.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Vue Test Utils
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vue-devtools" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Devtools
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-subitem"><a href="https://news.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Weekly news
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="支持 Vue" class="dropdown-title"><span class="title">支持 Vue</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/support-vuejs/#one-time-donations" class="nav-link">
  一次性捐款
</a></li><li class="dropdown-item"><!----> <a href="/support-vuejs/#recurring-pledges" class="nav-link">
  周期性捐款
</a></li><li class="dropdown-item"><!----> <a href="https://www.smallsticker.com/%E8%B4%B4%E7%BA%B8/vue.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  贴纸
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://osholic.com/?utm_source=vue&amp;utm_medium=dropdown" target="_blank" rel="noopener noreferrer" class="nav-link external">
  周边
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://vue.threadless.com/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  T-Shirt 商店
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="多语言" class="dropdown-title"><span class="title">多语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://v3.vuejs.org" target="_blank" rel="noopener noreferrer" class="nav-link external">
  English
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <a href="https://github.com/vuejs/docs-next-zh-cn" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><a href="/api/application-config.html" aria-current="page" class="active sidebar-link">应用配置</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/api/application-config.html#errorhandler" class="sidebar-link">errorHandler</a></li><li class="sidebar-sub-header"><a href="/api/application-config.html#warnhandler" class="sidebar-link">warnHandler</a></li><li class="sidebar-sub-header"><a href="/api/application-config.html#globalproperties" class="sidebar-link">globalProperties</a></li><li class="sidebar-sub-header"><a href="/api/application-config.html#iscustomelement" class="sidebar-link">isCustomElement</a></li><li class="sidebar-sub-header"><a href="/api/application-config.html#optionmergestrategies" class="sidebar-link">optionMergeStrategies</a></li><li class="sidebar-sub-header"><a href="/api/application-config.html#performance" class="sidebar-link">performance</a></li></ul></li><li><a href="/api/application-api.html" class="sidebar-link">应用 API</a></li><li><a href="/api/global-api.html" class="sidebar-link">全局 API</a></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>选项</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/api/options-data.html" class="sidebar-link">Data</a></li><li><a href="/api/options-dom.html" class="sidebar-link">DOM</a></li><li><a href="/api/options-lifecycle-hooks.html" class="sidebar-link">生命周期钩子</a></li><li><a href="/api/options-assets.html" class="sidebar-link">选项/Assets</a></li><li><a href="/api/options-composition.html" class="sidebar-link">组合</a></li><li><a href="/api/options-misc.html" class="sidebar-link">其他</a></li></ul></section></li><li><a href="/api/instance-properties.html" class="sidebar-link">实例 property</a></li><li><a href="/api/instance-methods.html" class="sidebar-link">实例方法</a></li><li><a href="/api/directives.html" class="sidebar-link">指令</a></li><li><a href="/api/special-attributes.html" class="sidebar-link">特殊指令</a></li><li><a href="/api/built-in-components.html" class="sidebar-link">内置组件</a></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>响应性 API</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/api/basic-reactivity.html" class="sidebar-link">响应性基础 API</a></li><li><a href="/api/refs-api.html" class="sidebar-link">Refs</a></li><li><a href="/api/computed-watch-api.html" class="sidebar-link">Computed 与 watch</a></li></ul></section></li><li><a href="/api/composition-api.html" class="sidebar-link">组合 API</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="应用配置"><a href="#应用配置" class="header-anchor">#</a> 应用配置</h1> <p><code>config</code> 是一个包含了 Vue 应用全局配置的对象。你可以在应用挂载前修改其以下 property：</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span> app <span class="token operator">=</span> Vue<span class="token punctuation">.</span><span class="token function">createApp</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span>

app<span class="token punctuation">.</span>config <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h2 id="errorhandler"><a href="#errorhandler" class="header-anchor">#</a> errorHandler</h2> <ul><li><p><strong>类型</strong>：<code>Function</code></p></li> <li><p><strong>默认</strong>：<code>undefined</code></p></li> <li><p><strong>用法</strong>：</p></li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code>app<span class="token punctuation">.</span>config<span class="token punctuation">.</span><span class="token function-variable function">errorHandler</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">err<span class="token punctuation">,</span> vm<span class="token punctuation">,</span> info</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token comment">// 处理错误</span>
  <span class="token comment">// `info` 是 Vue 特定的错误信息，比如错误所在的生命周期钩子</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p>指定一个处理函数，来处理组件渲染方法执行期间以及侦听器抛出的未捕获错误。这个处理函数被调用时，可获取错误信息和应用实例。</p> <blockquote><p>错误追踪服务 <a href="https://sentry.io/for/vue/" target="_blank" rel="noopener noreferrer">Sentry<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 和 <a href="https://docs.bugsnag.com/platforms/browsers/vue/" target="_blank" rel="noopener noreferrer">Bugsnag<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 使用此选项提供官方集成。</p></blockquote> <h2 id="warnhandler"><a href="#warnhandler" class="header-anchor">#</a> warnHandler</h2> <ul><li><p><strong>类型</strong>：<code>Function</code></p></li> <li><p><strong>默认</strong>：<code>undefined</code></p></li> <li><p><strong>用法</strong>：</p></li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code>app<span class="token punctuation">.</span>config<span class="token punctuation">.</span><span class="token function-variable function">warnHandler</span> <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">msg<span class="token punctuation">,</span> vm<span class="token punctuation">,</span> trace</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token comment">// `trace` 是组件的继承关系追踪</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p>为 Vue 的运行时警告指定一个自定义处理函数。注意这只会在开发环境下生效，在生产环境下它会被忽略。</p> <h2 id="globalproperties"><a href="#globalproperties" class="header-anchor">#</a> globalProperties</h2> <ul><li><p><strong>类型</strong>：<code>[key: string]: any</code></p></li> <li><p><strong>默认</strong>：<code>undefined</code></p></li> <li><p><strong>用法</strong>：</p></li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code>app<span class="token punctuation">.</span>config<span class="token punctuation">.</span>globalProperties<span class="token punctuation">.</span>foo <span class="token operator">=</span> <span class="token string">'bar'</span>

app<span class="token punctuation">.</span><span class="token function">component</span><span class="token punctuation">(</span><span class="token string">'child-component'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
  <span class="token function">mounted</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>foo<span class="token punctuation">)</span> <span class="token comment">// 'bar'</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>添加可以在应用程序内的任何组件实例中访问的全局 property。属性名冲突时，组件的 property 将具有优先权。</p> <p>这可以代替 Vue 2.x <code>Vue.prototype</code> 扩展：</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">// 之前(Vue 2.x)</span>
<span class="token class-name">Vue</span><span class="token punctuation">.</span>prototype<span class="token punctuation">.</span><span class="token function-variable function">$http</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>

<span class="token comment">// 之后(Vue 3.x)</span>
<span class="token keyword">const</span> app <span class="token operator">=</span> Vue<span class="token punctuation">.</span><span class="token function">createApp</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
app<span class="token punctuation">.</span>config<span class="token punctuation">.</span>globalProperties<span class="token punctuation">.</span><span class="token function-variable function">$http</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><h2 id="iscustomelement"><a href="#iscustomelement" class="header-anchor">#</a> isCustomElement</h2> <ul><li><p><strong>类型</strong>：<code>(tag: string) =&gt; boolean</code></p></li> <li><p><strong>默认</strong>：<code>undefined</code></p></li> <li><p><strong>用法</strong>：</p></li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">// 任何以“ion-”开头的元素都将被识别为自定义元素</span>
app<span class="token punctuation">.</span>config<span class="token punctuation">.</span><span class="token function-variable function">isCustomElement</span> <span class="token operator">=</span> <span class="token parameter">tag</span> <span class="token operator">=&gt;</span> tag<span class="token punctuation">.</span><span class="token function">startsWith</span><span class="token punctuation">(</span><span class="token string">'ion-'</span><span class="token punctuation">)</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>指定一个方法，用来识别在 Vue 之外定义的自定义元素（例如，使用 Web Components API）。如果组件符合此条件，则不需要本地或全局注册，并且 Vue 不会抛出关于 <code>Unknown custom element</code> 的警告。</p> <blockquote><p>注意，所有原生 HTML 和 SVG 标记不需要在此函数中匹配——Vue 解析器自动执行此检查。</p></blockquote> <h2 id="optionmergestrategies"><a href="#optionmergestrategies" class="header-anchor">#</a> optionMergeStrategies</h2> <ul><li><p><strong>类型</strong>：<code>{ [key: string]: Function }</code></p></li> <li><p><strong>默认</strong>：<code>{}</code></p></li> <li><p><strong>用法</strong>：</p></li></ul> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span> app <span class="token operator">=</span> Vue<span class="token punctuation">.</span><span class="token function">createApp</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  <span class="token function">mounted</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>$options<span class="token punctuation">.</span>hello<span class="token punctuation">)</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>

app<span class="token punctuation">.</span>config<span class="token punctuation">.</span>optionMergeStrategies<span class="token punctuation">.</span><span class="token function-variable function">hello</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">parent<span class="token punctuation">,</span> child<span class="token punctuation">,</span> vm</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">Hello, </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>child<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span>
<span class="token punctuation">}</span>

app<span class="token punctuation">.</span><span class="token function">mixin</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  hello<span class="token operator">:</span> <span class="token string">'Vue'</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>

<span class="token comment">// 'Hello, Vue</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><p>为自定义选项定义合并策略。</p> <p>合并策略选项分别接收在父实例和子实例上定义的该选项的值作为第一个和第二个参数，引用上下文实例被作为第三个参数传入。</p> <ul><li><strong>参考</strong>：<a href="/guide/mixins.html#自定义选项合并策略">自定义选项合并策略</a></li></ul> <h2 id="performance"><a href="#performance" class="header-anchor">#</a> performance</h2> <ul><li><p><strong>类型</strong>：<code>boolean</code></p></li> <li><p><strong>默认</strong>：<code>false</code></p></li> <li><p><strong>用法</strong>：</p></li></ul> <p>设置为 <code>true</code> 以在浏览器开发工具的 performance/timeline 面板中启用对组件初始化、编译、渲染和更新的性能追踪。只适用于开发模式和支持 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark" target="_blank" rel="noopener noreferrer">performance.mark<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> API 的浏览器。</p></div> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/api/application-api.html">应用 API</a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.0a9bf1a0.js" defer></script><script src="/assets/js/9.f307b0a5.js" defer></script><script src="/assets/js/18.9c9769d1.js" defer></script><script src="/assets/js/10.523605bb.js" defer></script><script src="/assets/js/36.e0922c67.js" defer></script>
  </body>
</html>
